-
Notifications
You must be signed in to change notification settings - Fork 37
feat: Switch to Gradle using Plugin with both Java and Kotlin, and many more features #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
ItsNeil17
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the PR - are there any direct advantages over this instead of gh-7?
Also could you please use the server from the maven instead now?
|
The plugin already uses the official Hytale Maven for the server.jar, as the features I described say. I have a fallback in my code to a launcher file that I intend to expose as a config option, but it is currently not used. Differences between this and the other PR with the ultradev plugin:
|
ItsNeil17
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - thank you very much!
|
Just quickly added a build script too for those who like to use that, the plugin works in both settings and build ;) |
|
Hey! We also need to change these guides based on this - I would do it but I'm not experienced with gradle. https://github.com/HytaleModding/site/blob/main/content/docs/en/guides/plugin/build-and-test.mdx |
|
No worries, I can make the changes ;) |
|
Is #7 Not needed anymore? This pretty much look like a replacement... |
|
Yeah I don't think its needed anymore. |
@adaliszk did you submit a PR? |
@ItsNeil17 preparing it in the evening and will ping you soon |
|
Is it the best idea to be shipping such an opinionated gradle plugin in a template on the most widely known modding site? im all for ease of use, providing a way to run a server and generate sources is one thing, but everything else feels over the top, more like something that would ship with a framework that endorses it rather than a generic template. I feel like sticking as close to vanilla practices as possible while the ecosystem works itself out is the best bet. On another note, I think you should be able to select a JetBrains Hot-Reload Capable JVM with https://github.com/gradle/foojay-toolchains for the user if im understanding correctly, might be worth looking into. fwiw ive got a template generator akin to fabrics one in the works at my fork, I can put it up as a draft pr if you want |
Switching to the ScaffoldIt Gradle Plugin adding:
- HytaleServer.jar via the official Hytale maven
- Monorepo support via `common {}` block
- Kotlin support via `useKotlin()` function
- Hot-reloading using DCEVM JVM and IDEA
- Automatic manifest in-place generation
- Automatic source path scaffolding
- Source-linked Devserver for zero jar
- Source-linked Asset Editor
|
While the plugin pre-sets a lot of things and is prepared for multiple project templates, rather than writing less sophisticated plugins per setup type, I do not think it goes beyond vanilla, except for not anticipating a split-brain situation with both settings and build scripts both configuring the same thing, but from slightly different angles. However, you can still write your long, 300-line, verbose vanilla scripts if you wish. If I'm missing any hooks you need, do tell me. I am happy to expose those, as my general goal is not to hide the configuration behind an opinion but to set sensible defaults, especially for those who are picking up Java for the first time. The upcoming changes will focus on configuration and on exposing every single toggle. The only framework-related feature to me is the agent that ships the more complicated part of hot reloading that the simple DCEVM JVM is not capable of, namely, reloading your actual plugin even when you have dependencies. That is something none of the other plugins can do, as none of them goes beyond a run configuration. The only other alternative is installing a devtools mod that replaces the Hytale plugin manager with its own solution, which, while it may work, will be a burden to maintain and not cause any side effects. |
|
In any case, it is up to the maintainers. I was merely offering a zero boilerplate option that goes in the direction of Stonecutter and Blahaj from Minecraft modding. Regarding the pages, I am working on them; from what I can see, they would remain mostly the same, though I am not sure about fully dropping the Maven sections, as they are undoubtedly very useful. |
Slight self-promotion, but added my Gradle plugin to handle Hytale modding, which gives the ability to:
This should solve #6 nicely without mixing the contexts.